#region Using directory
using System;
using Microsoft.DirectX;
using System.Drawing;
#endregion

namespace SharpWind.Helpers
{
	public class Random
	{
		#region Fields

		private System.Random randomGenerator = null;

		#endregion

		#region Constructor

		public Random()
		{
			this.randomGenerator = new System.Random( (int)DateTime.Now.Ticks );
		}

		#endregion

		#region Methods

		public int GetInt( int max )
		{
			return this.randomGenerator.Next( max );
		}

		public int GetInt( int min, int max )
		{
			return this.randomGenerator.Next( min, max );
		}

		public float GetFloat( float min, float max )
		{
			return (float)this.randomGenerator.NextDouble() * ( max - min ) + min;
		}

		public byte GetByte( byte min, byte max )
		{
			return (byte)this.randomGenerator.Next( min, max );
		}

		public Vector2 GetVector2( float min, float max )
		{
			return new Vector2( GetFloat( min, max ),
								GetFloat( min, max ) );
		}

		public Vector3 GetVector3( float min, float max )
		{
			return new Vector3( GetFloat( min, max ),
								GetFloat( min, max ),
								GetFloat( min, max ) );
		}

		public Color GetColor()
		{
			return Color.FromArgb( GetInt( 255 ),
								   GetInt( 255 ),
								   GetInt( 255 ),
								   GetInt( 255 ) );
		}

		#endregion
	}
}
